//
//  TelBookColCell.swift
//  myencphoto
//
//  Created by cyptt on 2023/7/18.
//

import UIKit
import QuickLook
@available(iOS 11.0, *)
class CHPDFColCell: UICollectionViewCell {
    

    override func awakeFromNib() {
        super.awakeFromNib()
    
        self.backgroundColor = UIColor.yellow
        self.setUI()
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        self.setUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUI(){
        
        self.contentView.addSubview(self.pdfView)
        
        self.addSubview(self.pageLabel)
 

 
                             
        
    }
    
    public lazy var pdfView = {()-> PDFView in
    
        let v:PDFView = PDFView()
        v.autoScales = true // 根据需要自动缩放PDF
        v.frame = self.bounds
        return v
    }()
    
    
    public lazy var pageLabel = {()-> UILabel in
    
        let v:UILabel = UILabel.init(frame: CGRect.init(x: DEFAULT_SCREEN_WIDTH - 80, y: 20, width: 60, height: 26))

        v.layer.cornerRadius = 5
        v.layer.masksToBounds = true
        v.textAlignment = .center
        v.backgroundColor = UIColor.init(red: 50/255.0, green: 50/255.0, blue: 50/255.0, alpha: 0.7)

        v.textColor = UIColor.white
        return v
    }()
}
